import 'dart:async';
import 'package:flutter_easyloading/flutter_easyloading.dart';

class CustomLoading {

  String name='';
  CustomLoading();
  CustomLoading.withMessage(String name){
    this.name = name;
  }
  show({String message='',int delay=8}){
    EasyLoading.show(status:message==''?name:message,maskType:EasyLoadingMaskType.black);
    Timer(Duration(seconds: delay), () {
      EasyLoading.dismiss();
    });
  }
  dismiss(){
    EasyLoading.dismiss();
  }
  showProgress(data,status){
    EasyLoading.showProgress(data,status: status);
  }
}